<cfscript>    
    view = createObject("component", session.rootDir & ".views.layout");
    if( Session.Auth EQ True and (Session.strAuthType EQ Session.MANAGERS or Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR or Session.Manager) ){
        view.init("Step 1:  Liaison - Contractor Request",
            "/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js, /" & session.rootDir & "/static/js/NonSCF/Step1-Request.js",
            "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css","Home",index);
    }else{
        view.init("Denied","","","Home","Denied");
    }    
    view.html();
</cfscript>

<cffunction name="index" access="public" output="true" returntype="any">
    <cfscript>
        import models.*;
        FormAction = '/#session.rootDir#/controller/SubmitHandler.cfm?NonSCFStep1=add';
        KronosQueries = CreateObject("component", session.rootDir & ".DatabaseQueries.Kronos");
        AccessControlQueries = CreateObject("component", session.rootDir & ".DatabaseQueries.AccessControl");
        GetContainer = EntityLoad("ADContainer");
        GetLunch = EntityLoad("Lunch");
        GetNonSCFTypes = EntityLoad("NonSCFTypes");
        GetDepts = KronosQueries.funcGetDepts();
        GetSupDept = KronosQueries.funcGetSupDept(Session.HRID);
        GetAccess = AccessControlQueries.funcGetAccess();
        GetStates = KronosQueries.funcGetStates();
        GetPhoneTypes = KronosQueries.funcGetPhoneTypes();
    </cfscript>
    
    <cfoutput> 
    <h1 class="title">Step 1:  Liaison - Contractor Request</h1>
        <div class="entry">    
            Welcome, #Session.EmpInfo.FirstName# #Session.EmpInfo.LastName#.  
            In this step, we'll capture information necessary to initiate the 
            request for the Network Account and Badge.
            Please provide the following information: 
            <br /><br /> 

            <div class="notes">
                <table>
                    <tr>
                        <td valign="top">
                            NOTE:&nbsp;&nbsp;
                        </td>
                        <td>
                            This page is for <u><em>NON</em></u> SCF employees only.  To process SCF employees click <a href="../SCF/Step1-Hire.cfm">here</a>.
                        </td>
                    </tr>
                </table>
            </div>            
            
            <cfform name="frmStep1" method="post" action="#FormAction#">
                <table class="main">
                    <tr>
                        <td>First, MI, Last:</td>
                        <td>
                            <cfinput type="text" name="FirstName" error_message="Please provide a first name."  tabindex="5" >                                
                            <cfinput type="text" name="MiddleName" size=1 maxlength="2" required="no" tabindex="7" >                                                        
                            <cfinput type="text" name="LastName" error_message="Please provide a last name." tabindex="10" >
                        </td>
                    </tr>
                    <tr>
                        <td>Preferred (First) Name:</td>
                        <td>
                            <cfinput type="text" name="PreferredName" tabindex="20" tooltip="Would appear in the Address Book and be used to create their network account." />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            SSN:
                        </td>
                        <td>
                            <cfinput type="text" name="SSN" tabindex="25" value="" error_message="Please provide a valid SSN of format xxx-xx-xxxx">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Non-SCF Type:
                        </td>
                        <td>
                            <cfselect name="NonSCFTypeID" tabindex="25" >
                                <cfloop from="1" to="#ArrayLen(GetNonSCFTypes)#" index='i'>
                                    <option value="#GetNonSCFTypes[i].getNonSCFTypeID()#">#GetNonSCFTypes[i].getNonSCFType()#</option>
                                </cfloop>
                            </cfselect>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Company Name:
                        </td>
                        <td>
                            <cfinput type="text" name="Company" tabindex="30" tooltip="'Volunteer' or Contracted Company Name." value="" error_message="Please provide a Company for this individual.  Type 'Volunteer' for volunteers or use the Company the contractor works for." >
                        </td>
                    </tr>
                    <TR>
                        <TD>
                            Department:
                        </TD>
                        <TD colspan=3>
                            <cfselect name="DepartmentID" tabindex="25" >
                                <cfloop query="GetDepts">
                                    <option value="#GetDepts.OrgCodeIDNo#">#GetDepts.Org#</option>
                                </cfloop>
                            </cfselect>                           
                        </TD>
                    </TR>
                    <TR>
                        <TD valign="top">
                            Comments:
                        </TD>
                        <TD colspan=3>
                            <cftextarea rows="2" tabindex="65" name="Comments" style="width:98%"/>
                        </TD>
                    </TR>
                    <tr>
                        <td colspan="4">
                            <fieldset>
                            <legend><strong>Network Account and Badge Information:</strong></legend>
                                <table>
                                    <tr>
                                        <td colspan=5>
                                            <cfinput type="checkbox" name="NonSCFNetworkAccount" > Network Account<br />
                                                <div id="NA" style="display:none">
                                                <table>
                                                    <cfinput type="hidden" name="AccountMirror" value="0" />
                                                    <tr>
                                                        <td width="25">&nbsp;</td>
                                                        <td>
                                                            Phone Ext:
                                                        </td>
                                                        <td>
                                                            <cfinput type="text" name="DeskPhone" maxlength="6" tabindex="80" 
                                                                tooltip="If a phone already exists at the employees work station, what is the 4 digit extension?" 
                                                                value="">
                                                        </td>
                                                    </tr>
                                                    <TR>
                                                        <td>&nbsp;</td>
                                                        <TD>
                                                            Location/Container:
                                                        </TD>
                                                        <TD>
                                                            <cfselect name="ContainerID" tabindex="140" selected="7" >
                                                                <cfloop from="1" to="#ArrayLen(GetContainer)#" index="i">
                                                                    <option value="#GetContainer[i].getADContainerID()#" <cfif GetContainer[i].getADContainerID() EQ 7>selected=selected </cfif>>#GetContainer[i].getContainer()#</option>
                                                                </cfloop>
                                                            </cfselect>
                                                        </TD>
                                                    </TR>
                                               </table>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan=5>
                                            <cfinput type="checkbox" name="NonSCFBadge"> Badge<br />
                                                <div id="Badge" style="display:none">
                                                <table>
                                                    <tr>
                                                        <td width="25">&nbsp;</td>
                                                        <td valign="top">
                                                            Position (Badge):
                                                        </td>
                                                        <td>
                                                            <cfinput type="text" name="BadgePos" tabindex="100" 
                                                            tooltip="Enter the Position as it should appear on the Badge" 
                                                            value="" style="width:98%" 
                                                            error_message="Please enter the Position as it should appear on the Badge.">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>&nbsp;</td>
                                                        <td valign="top">
                                                            Badge Level Access:
                                                        </td>
                                                        <td>
                                                            <cfselect name="BadgeAccessLevelID" tabindex="70"  multiple="yes">
                                                                <option value="0">-- None --</option>
                                                                 <cfloop query="GetAccess">
                                                                    <option value="#AccessLvID#">#Descript#</option>
                                                                </cfloop> 
                                                            </cfselect>  
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td>&nbsp;</td>
                                    </tr>                                   
                                    <TR>
                                        <td width="10">&nbsp;</td>
                                        <TD>
                                            Estimated Start Date: <BR /><BR />
                                            <cfinput type="hidden" name="EstStartDate" value="#DateFormat(now(), 'mm/dd/yyyy')#"/>
                                            <div id="EstStart_datepicker"></div>
                                        </TD>
                                        <td width="10">&nbsp;</td>
                                        <TD valign="top">
                                            <div class="notes"><BR />NOTE:&nbsp;&nbsp;&nbsp;</div>
                                        </TD>
                                        <TD valign="top">
                                            <div class="notes"><BR />Expiration Date for this account will be set to one (1) month from the Actual Start Date (to be confirmed by HR).  Every month, a request from the supervisor will be required to extend the expiration date.  If a request is not made, the account and badge will expire on the expiration date.</div>
                                        </TD>
                                        <td width="10">&nbsp;</td>
                                    </TR>
                                </table>
                            </fieldset>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5" align="right">
                            <cfinput type="button" name="Submit" value="Next >>" tabindex="150">
                            <cfinput type="hidden" name="FormAction" value="#FormAction#">
                        </td>
                    </tr>
                </table>
            </cfform>            
        </div>    
    </cfoutput>
    
</cffunction>